package ar.com.vates.vsp.capitulo5.contenedor;

import java.util.Random;



public class Escritor extends Thread {
	
	Contenedor buffer;
    int elem;
    Random rad=new Random();
   
    Escritor(Contenedor b ){
        
        buffer=b;
      //  System.out.println(" entra el productor "+ i);
       }
       public void run(){
           try{
        
        	   for(int i=0;i<11;i++)
                     
           {    
              elem = i;
        	  buffer.insertar(elem);
        	  Thread.sleep((int)(rad.nextDouble()*1500));
           }
           
           
           }catch(Exception e){};
      
        return;
       }

}
